/*
 * Copyright 2000-2006 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.intellij.gwt.run;

import com.intellij.execution.configurations.ConfigurationFactory;
import com.intellij.execution.configurations.ConfigurationType;
import com.intellij.gwt.GwtConfiguration;
import com.intellij.gwt.GwtBundle;
import com.intellij.openapi.application.ApplicationManager;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;

public class GwtRunConfigurationType implements ConfigurationType {
  private GwtRunConfigurationFactory myConfigurationFactory;

  GwtRunConfigurationType() {
    myConfigurationFactory = new GwtRunConfigurationFactory(this);
  }

  public String getDisplayName() {
    return GwtBundle.message("run.gwt.configuration.display.name");
  }

  public String getConfigurationTypeDescription() {
    return GwtBundle.message("run.gwt.configuration.description");
  }

  public Icon getIcon() {
    return GwtConfiguration.SMALL_ICON;
  }

  public ConfigurationFactory[] getConfigurationFactories() {
    return new ConfigurationFactory[]{myConfigurationFactory};
  }

  public static GwtRunConfigurationFactory getFactory() {
    return ApplicationManager.getApplication().getComponent(GwtRunConfigurationType.class).myConfigurationFactory;
  }

  @NonNls
  @NotNull
  public String getComponentName() {
    return "GWT.ConfigurationType";
  }

  public void initComponent() {
  }

  public void disposeComponent() {
  }

}

